const { spawn } = require('child_process')

const cp = spawn('./large-output', {stdio: [0,1,2]})

const cp1 = spawn('./throw-exception', {stdio: [0,1,2]})

let errMsg = ''
cp1.stderr.on('data', (data)=>{
  errMsg = data.toString()

})
cp.on('close', ()=>{
  console.log('master-process-error', errMsg)

})
